/**
 * Filename: YNFileComparator.java
 *
 * @author Firefly
 * @contact postfirefly@163.com
 * @time 2016/3/17 15:19
 */
package com.github.postsanf.yinian.bean;

import java.util.Comparator;

public class YNFileComparator implements Comparator<YNFileInfo> {
    @Override
    public int compare(YNFileInfo lhs, YNFileInfo rhs) {
        if (lhs.getLastModified() < rhs.getLastModified()) {
            return 1;//最后修改的照片在前
        } else if (lhs.getLastModified() == rhs.getLastModified()) {
            return 0;//此处需要返回0；
        } else {
            return -1;
        }
    }
}